﻿// -----------------------------------------------------------------------------
// 园丁,是个很简单的管理系统
//  gitee:https://gitee.com/hgflydream/Gardener 
//  issues:https://gitee.com/hgflydream/Gardener/issues 
// -----------------------------------------------------------------------------

using Gardener.Core.AppManager.Resources;

namespace Gardener.Core.AppManager.Dtos
{
    /// <summary>
    /// 应用
    /// </summary>
    [Display(Name = nameof(AppManagerResource.App), ResourceType = typeof(AppManagerResource))]
    public class AppDto : BaseDto<Guid>
    {
        /// <summary>
        /// 名称
        /// </summary>
        [Display(Name = nameof(AppManagerResource.AppName), ResourceType = typeof(AppManagerResource))]
        [Required(ErrorMessageResourceType = typeof(ValidateErrorMessagesResource), ErrorMessageResourceName = nameof(ValidateErrorMessagesResource.RequiredValidationError))]
        [MaxLength(200, ErrorMessageResourceType = typeof(ValidateErrorMessagesResource), ErrorMessageResourceName = nameof(ValidateErrorMessagesResource.StringMaxValidationError))]
        public string AppName { get; set; } = default!;

        /// <summary>
        /// 描述
        /// </summary>
        [Display(Name = nameof(AppManagerResource.AppDescription), ResourceType = typeof(AppManagerResource))]
        [Required(ErrorMessageResourceType = typeof(ValidateErrorMessagesResource), ErrorMessageResourceName = nameof(ValidateErrorMessagesResource.RequiredValidationError))]
        [MaxLength(500, ErrorMessageResourceType = typeof(ValidateErrorMessagesResource), ErrorMessageResourceName = nameof(ValidateErrorMessagesResource.StringMaxValidationError))]
        public string AppDescription { get; set; } = default!;

        /// <summary>
        /// 应用版本
        /// </summary>
        public ICollection<AppVersionDto> AppVersions { get; set; } = [];
    }
}
